<template>
  <div>
    <!-- 头部 -->
    <Header />
    <!-- 中间 -->
    <div class="payContainer">
      <div class="pay">
        <!-- 第一行 -->
        <div class="payHeader">
          <span class="iconfont icon-shizhong"></span>
          请在 <span class="time">26:33</span> 内完成支付, 超时订单会自动取消
        </div>
        <!-- 第二行 -->
        <div class="paySecond">
          <div class="left">项目:{{ name }}</div>
          <div class="right">
            应付金额 ¥ <span>{{ price }}</span>
          </div>
        </div>
        <!-- 支付方式 -->
        <div class="payMethods">
          <div class="payMethodsItem">
            <ul class="payMethodsSelect">
              <li class="active">支付宝/微信</li>
              <li>个人网银支付</li>
            </ul>
            <ul class="payOthers">
              <li class="payHelp">
                支付帮助<span class="iconfont icon-xialasanjiao"></span>
              </li>
              <li class="paySuggest">意见反馈</li>
            </ul>
          </div>
          <div class="payImg">
            <ul class="payType">
              <li class="weiXin">
                <input type="radio" name="pay" value="weixin" />
                <label>
                  <img src="./images/ia_300000006.png" />
                </label>
              </li>
              <li class="zfb">
                <input type="radio" name="pay" value="zfb" />
                <label>
                  <img src="./images/ia_300000007.png" />
                </label>
              </li>
            </ul>
          </div>
          <div class="amount">
            支付￥
            <span class="amountPrice">{{ price }}</span>
          </div>
          <div class="payFooter">
            <a @click="goOrder">返回修改订单</a>
            <button class="payMoney">去付款</button>
          </div>
        </div>
      </div>
    </div>
    <!-- 底部 -->
    <Footer />
  </div>
</template>

<script setup>
import Header from "../../components/Header";
import Footer from "../../components/Footer";
import { onMounted, ref } from "vue";
import { useRouter } from "vue-router";

const route = useRouter();
const name = ref();
const price = ref();
onMounted(() => {
  //   console.log(route.currentRoute.value.query);
  // 获取传递过来的商品名和价格
  name.value = route.currentRoute.value.query.name;
  price.value = route.currentRoute.value.query.price;
});
const goOrder = () => {
  route.push({
    path: "/order",
    query: { name: name.value, price: price.value },
  });
};
</script>

<style scoped>
* {
  height: 100%;
  background-color: #f8f8f8;
}
.payContainer {
  padding: 0 20px 50px;
}
.payContainer .pay {
  margin: 20px auto;
  width: 1180px;
  height: 500px;
  padding-top: 20px;
  padding-bottom: 40px;
  /* border: 1px solid red; */
}
.pay .payHeader {
  width: 100%;
  height: 40px;
  line-height: 40px;
  margin-bottom: 20px;
  background-color: #fff;
  box-shadow: 0 3px 5px 0 rgb(0 0 0 / 10%);
  border-radius: 4px;
  text-align: center;
  font-size: 14px;
  color: #666;
}
.pay .payHeader .iconfont {
  background-color: #fff;
  color: #ff6600;
  font-size: 25px;
}
.pay .payHeader .time {
  font-size: 18px;
  color: #ff6600;
  font-weight: bold;
  background-color: #fff !important;
}
.pay .paySecond {
  width: 100%;
  height: 72px;
  line-height: 72px;
  padding: 5px;
  margin-bottom: 10px;
  border: 1px solid #e5e5e5;
  background-color: #fff !important;
  display: flex;
  justify-content: space-between;
}
.pay .paySecond .left {
  width: 800px;
  font-size: 20px;
}
.pay .paySecond .right {
  color: #ff6600;
  font-size: 14px;
}
.pay .paySecond .right > span {
  font-size: 30px;
  background-color: #fff !important;
}
.pay .paySecond .left,
.right {
  padding-left: 20px;
  padding-right: 20px;
  background-color: #fff !important;
}

.payMethods {
  width: 100%;
  height: 350px;
  background-color: #fff !important;
  border: 1px solid #e5e5e5;
  justify-content: space-between;
  padding: 0 20px 50px;
}
.payMethods .payMethodsItem {
  width: 100%;
  height: 51px;
  border-bottom: 1px solid #e5e5e5;
  background-color: #fff !important;
}
.payMethodsSelect {
  float: left;
  height: 50px;
  background-color: #fff !important;
}
.payMethodsSelect li {
  float: left;
  list-style: none;
  padding: 10px;
  background-color: #fff !important;
}
.payMethodsSelect li:hover {
  border: 1px solid #e5e5e5;
}
.payOthers {
  float: right;
  height: 50px;
  background-color: #fff !important;
}
.payOthers li {
  float: left;
  list-style: none;
  padding: 10px;
  background-color: #fff !important;
}
.payOthers li .iconfont {
  background-color: #fff;
  color: #666;
  font-size: 12px;
}
.payImg {
  width: 100%;
  height: 100px;
  /* border: 1px solid blue; */
  margin-top: 20px;
  background-color: #fff !important;
}
.payImg .payType {
  margin: 0;
  padding: 0;
  height: 52px;
  list-style: none;
  display: flex;
  justify-content: left;
  background-color: #fff !important;
}
.payImg .payType li {
  background-color: #fff !important;
}
.payImg .payType label {
  background-color: #fff !important;
}
.payImg .payType img {
  width: 200px;
  height: 50px;
  border: 1px solid #e5e5e5;
  margin-left: 10px;
  margin-right: 10px;
  background-color: #fff !important;
}
.payImg .payType img:hover {
  border: 1px solid #00c9b3;
}
.payImg .payType input {
  vertical-align: middle;
  width: 13px;
  height: 13px;
  background-color: #fff !important;
}
.amount,
.payFooter {
  width: 100%;
  height: 50px;
  line-height: 50px;
  padding-right: 10px;
  /* border: 1px solid yellow; */
  background-color: #fff !important;
  text-align: right;
}
.amount {
  font-size: 14px;
  color: #ff6600;
}
.amount > span {
  font-size: 30px;
  background-color: #fff !important;
}
.payFooter a {
  color: #666;
  padding-right: 20px;
  background-color: #fff !important;
}
.payFooter a:hover {
  text-decoration: underline;
}
.payMoney {
  width: 150px;
  height: 50px;
  color: #fff;
  font-size: 14px;
  border: #ff6600;
  background-color: #f90;
  border-radius: 100px;
  background-image: linear-gradient(180deg, #ffa114, #f59300);
}
</style>
